/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.converter;

import br.com.deployment.entidade.fermojupi.AtoItem;
import br.com.deployment.entidade.fermojupi.AtoTipo;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

/**
 *
 * @author roniere
 */
@FacesConverter(value="atoItemConverter", forClass=AtoItem.class)  
public class AtoItemConverter  implements Converter {

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String value) {                
        AtoItem atoItem = new AtoItem();
        atoItem.setId(Integer.valueOf(value));  
        return atoItem;
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
         AtoItem atoItem = (AtoItem) value;
        return "" + atoItem.getId();
    }
    
    
}
